<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户密码修改</title>
<link href="../css/mq.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">	
	function checkPutIn(){
		var pattern=/^[a-zA-Z0-9][a-zA-Z0-9]{5,11}$/; 
		if(document.getElementById("adminOldPass").value == ""){
			alert("请输入旧密码");
			return false;
		}
		if(document.getElementById("adminNewPass").value == ""){
			alert("请输入新密码");
			return false;
		}
		if(document.getElementById("adminAgainPass").value == ""){
			alert("请输入确认密码");
			return false;
		}		 
		if(!pattern.test(document.getElementById("adminNewPass").value)){
			alert("密码必须是6到12位数字或字母");
			return false;
		}
		if(document.getElementById("adminNewPass").value != document.getElementById("adminAgainPass").value){
			alert("两次输入的密码不一致");
			document.getElementById("adminNewPass").value == "";
			document.getElementById("adminAgainPass").value == "";
			return false;
		}
		else{
			return true;
		}
	}
</script>
</head>

<body>
    
<div id="contentMain">
<div class="boxtitle"><span>修改用户密码</span> </div>	
<form action="updateUserPass.do" method="post"  namespace="/admin">
<table style="border-top:#dddddd solid 1px; border-bottom:#dddddd solid 1px" frame=below rules=rows  bordercolor="#FFFFFF" width="100%" border="1" cellspacing="0" cellpadding="4" >
  <tr>
    <td width="120px" class="tdstyle" align="right">旧密码：</td>
    <td><input name="password" id="adminOldPass" type="password" class="inputstyle-240px"/> </td>
  </tr>
   <tr>
    <td class="tdstyle" align="right">新密码：</td>
    <td><input name="newPassword" id="adminNewPass" type="password" class="inputstyle-240px" /></td>
  </tr>
   <tr>
    <td class="tdstyle" align="right">请再确认一次密码：</td>
    <td><input name="againNewPassword" id="adminAgainPass" type="password" class="inputstyle-240px" /></td>
  </tr>
</table>
<input type="hidden" name="useridStr" value='<s:property value="useridStr"/>' />
	
<div class="text_margin1">
	<input name="发送" type="submit" value=" 确 定 "  class="buttonstyle-2word" onclick = "return checkPutIn()"/>
  	<input name="重置" type="reset"  value=" 重 置 "  class="buttonstyle-2word" />
 </div>
 </form>
</div>

</body>
</html>
